package com.mini.vo;

import lombok.Data;

import java.util.List;
import java.util.Set;

/**
 * @author zl
 * @version 1.0
 * @date Created in 2020/2/20
 */
@Data
public class UserVO {

    private Long id;

    private String username;

    private String nickname;

    private Long deptId;

    private String deptName;

    @Deprecated
    private Set<String> roles;

    private String email;

    private String role;

    private String roleName;

    private Long skuId;

    private String skuName;


    private Long workRoomId;

    private String workRoomName;

    FullDeptVo fullDept = new FullDeptVo();

    private List<String> kdIds;

    public boolean isZhuanyuan() {
        if (roles == null || roles.size() == 0) {
            return false;
        }
        return roles.contains("YY_ZHUANYUAN") || roles.contains("JT_ZHUANYUAN");
    }

    public boolean isZhuanyuanOrZuzhang() {
        if (roles == null || roles.size() == 0) {
            return false;
        }
        return roles.contains("YY_ZHUANYUAN") || roles.contains("JT_ZHUANYUAN")
                || roles.contains("YY_ZUZHANG") || roles.contains("JT_ZUZHANG");
    }
}
